using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Cafechess.Chess.Engines
{
  /// <summary>
  /// Interface used to define the filtering behavior of our Crafty analysis information.
  /// </summary>
  public interface IFilterAnalysis
  {
    /// <summary>
    /// This is the main filter function used to decied what to do with our analysis data.
    /// It expects that on an insert the DataRow passed in should have the CraftyAnalysis.Hash
    /// column set to the row to replace.
    /// </summary>
    /// <param name="sideToMove">True white to move else black</param>
    /// <param name="table">Our table that holds all the rows.</param>
    /// <param name="row">the current analysis information to process/test</param>
    /// <returns>-1 = replace existing row (NOTE: must set row[CraftyAnalysis.Hash] to hash of row to replace,
    ///           0 = ignore this row, 
    ///           1 = add new row</returns>
    int Filter(bool sideToMove, DataTable table, double score, string line, ref int hash);
    int GetHashCode(string str);
  }
}
